 <?php if(!isset($_REQUEST	['order_print']) && !isset($_REQUEST['branch_report_exporter'])){?>
<script type="text/javascript" src="jQuery/Calender/calendarDateInput.js"></script>
<div class="admin_wrap">
<?php }?>
<?php ?>
<?php require_once('Connections/drycleaners_conn.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
?>

<?php 

if(isset($_SESSION["admin"])){	
			if(isset($_REQUEST['unit_of_measure_view'])){
						include"includes/unit_of_measure/view.php";
						}		
			else if(isset($_REQUEST['unit_of_measure_add'])  || isset($_REQUEST['unit_of_measure_edit'])){
						include"includes/unit_of_measure/form.php";
						}		
			else if(isset($_REQUEST['item_view'])){
					include"includes/item/view.php";
					}
					
			else if(isset($_REQUEST['item_add'])  || isset($_REQUEST['item_edit'])){
					include"includes/item/form.php";
					}			
					
			else if(isset($_REQUEST['type_of_service_view'])){
					include"includes/type_of_service/view.php";
					}
					
			else if(isset($_REQUEST['type_of_service_add'])  || isset($_REQUEST['type_of_service_edit'])){
					include"includes/type_of_service/form.php";
					}
						
			else if(isset($_REQUEST['material_view'])){
					include"includes/material/view.php";
					}
					
			else if(isset($_REQUEST['material_add'])  || isset($_REQUEST['material_edit'])){
					include"includes/material/form.php";
					}
					
			else if(isset($_REQUEST['branch_view'])){
					include"includes/branch/view.php";
					}
			else if(isset($_REQUEST['branch_add'])  || isset($_REQUEST['branch_edit'])){
					include"includes/branch/form.php";
					}
						
			else if(isset($_REQUEST['user_view'])){
						include"includes/user/view.php";
						}
			else if(isset($_REQUEST['user_add'])  || isset($_REQUEST['user_edit'])){
						include"includes/user/form.php";
						}
						
			else if(isset($_REQUEST['role_view'])){
					include"includes/role/view.php";
					}
					
				else if(isset($_REQUEST['role_add'])  || isset($_REQUEST['role_edit'])){
					include"includes/role/form.php";
					}
					
				else if(isset($_REQUEST['period_view'])){
					include"includes/period/view.php";
					}
					
				else if(isset($_REQUEST['period_add'])  || isset($_REQUEST['period_edit'])){
					include"includes/period/form.php";
					}
					
				else if(isset($_REQUEST['service_view'])){
					include"includes/service/view.php";
				}
					
				else if(isset($_REQUEST['service_add'])  || isset($_REQUEST['service_edit'])){
					include"includes/service/form.php";
					}
					
				else if(isset($_REQUEST['material_service_cost_view'])){
					include"includes/material_service_cost/view.php";
				}
					
				else if(isset($_REQUEST['material_service_cost_add'])  || isset($_REQUEST['material_service_cost_edit'])){
					include"includes/material_service_cost/form.php";
					}
					
			else if(isset($_REQUEST['theme_view'])){
					include"includes/theme/view.php";
				}
			else if(isset($_REQUEST['production_suborder_item_view'])){
					include"includes/suborder_item/request/view.php";
					}
			else if(isset($_REQUEST['branch_report_creator'])){
					include"includes/reports/branch/form.php";
					}
			else if(isset($_REQUEST['branch_report_exporter'])){
					include"includes/reports/branch/export_view.php";
					}
					
			else if(isset($_REQUEST['branch_inventory_report_creator'])){
					include"includes/reports/branch_inventory/form.php";
					}
			else if(isset($_REQUEST['branch_inventory_report_exporter'])){
					include"includes/reports/branch_inventory/export_view.php";
					}
					
					
			else if(isset($_REQUEST['customer_statement_creator'])){
					include"includes/reports/customer_statement/form.php";
					}
			else if(isset($_REQUEST['customer_statement_exporter'])){
					include"includes/reports/customer_statement/export_view.php";
					}
					
			else if(isset($_REQUEST['customers_statement_creator'])){
					include"includes/reports/customers_statement/form.php";
					}
			else if(isset($_REQUEST['customers_statement_exporter'])){
					include"includes/reports/customers_statement/export_view.php";
					}
					
			else if(isset($_REQUEST['customers_summary_creator'])){
					include"includes/reports/customers_summary/form.php";
					}
			else if(isset($_REQUEST['customers_summary_exporter'])){
					include"includes/reports/customers_summary/export_view.php";
					}
					
			else if(isset($_REQUEST['customers_unpaid_statement_creator'])){
					include"includes/reports/customers_unpaid_statement/form.php";
					}
					
			else if(isset($_REQUEST['customers_unpaid_statement_exporter'])){
					include"includes/reports/customers_unpaid_statement/export_view.php";
					}
					
			else if(isset($_REQUEST['sales_per_branch_creator'])){
					include"includes/reports/sales_per_branch/form.php";
					}
					
			else if(isset($_REQUEST['sales_per_branch_exporter'])){
					include"includes/reports/sales_per_branch/export_view.php";
					}
					
					

				else{
					include"includes/user/view.php";
					}
}					
else if(isset($_SESSION["production"])){
	 
			 if(isset($_REQUEST['main_store_view'])){
					include"includes/main_store/view.php";
					}
			if(isset($_REQUEST['main_store_item_view'])){
					include"includes/main_store/per_item_view.php";
					}		
					
			else if(isset($_REQUEST['production_suborder_view'])){
					include"includes/suborder/production_view.php";
					}
			else if(isset($_REQUEST['production_suborder_received_view'])){
					include"includes/suborder/production_received_view.php";
					}
			else if(isset($_REQUEST['production_suborder_declined_view'])){
					include"includes/suborder/production_declined_view.php";
					}
			else if(isset($_REQUEST['production_suborder_return_view'])){
					include"includes/suborder/production_return_view.php";
					}
			else if(isset($_REQUEST['production_suborder_returned_view'])){
					include"includes/suborder/production_returned_view.php";
					}
					
			else if(isset($_REQUEST['production_suborder_item_view'])){
					include"includes/suborder_item/request/view.php";
					}		
					
			else if(isset($_REQUEST['order_item_approve_view'])){
					include"includes/order_item/approve/view.php";
					}
					
			else if(isset($_REQUEST['order_item_recieve'])){
					include"includes/order_item/receive/form.php";
					}
			
					
			else if(isset($_REQUEST['order_item_recieve_view'])){
					include"includes/order_item/receive/view.php";
					}
			
			else if(isset($_REQUEST['production_suborder_item_view'])){
					include"includes/suborder_item/request/view.php";
					}

			else{
					include"includes/suborder/production_view.php";
				}
}

else if(isset($_SESSION["receptionist"])){	
					
		//customer			
		 if(isset($_REQUEST['customer_view'])){
					include"includes/customer/view.php";
			}
					
				else if(isset($_REQUEST['customer_add'])  || isset($_REQUEST['customer_edit'])){
							include"includes/customer/form.php";
				}
		//Orders			
				else if(isset($_REQUEST['order_view'])){
					include"includes/order/view.php";
					}
					
				else if(isset($_REQUEST['order_production_return_view'])){
					include"includes/order/production_return_view.php";
					}
					
			else if(isset($_REQUEST['suborder_returned_receive_view'])){
					include"includes/order/suborder_returned_receive_view.php";
					}
			else if(isset($_REQUEST['suborder_returned_received_view'])){
					include"includes/order/suborder_returned_received_view.php";
					}
			else if(isset($_REQUEST['pick_up_view'])){
					include"includes/order/pickup_view.php";
					}
			else if(isset($_REQUEST['picked_up_view'])){
					include"includes/order/pickedup_view.php";
					}
					
				else if(isset($_REQUEST['order_payment_view'])){
					include"includes/payment/view.php";
					}
						
					
				else if(isset($_REQUEST['order_add'])  || isset($_REQUEST['order_edit'])){
					include"includes/order/form.php";
					}
					
				else if(isset($_REQUEST['order_item_view'])){
					include"includes/order_item/request/view.php";
					}
				else if(isset($_REQUEST['order_item_payment_view'])){
					include"includes/order_item/request/payment_view.php";
					}
				else if(isset($_REQUEST['order_installment_payment_view'])){
					include"includes/payment/installments/view.php";
					}
					
				else if(isset($_REQUEST['order_installment_paid_view'])){
					include"includes/payment/installments/paid_view.php";
					}
					
				else if(isset($_REQUEST['order_installment_payment_add']) || isset($_REQUEST['order_installment_payment_edit'])){
					include"includes/payment/installments/form.php";
					}
					
				else if(isset($_REQUEST['order_item_add'])  || isset($_REQUEST['order_item_edit'])){
					include"includes/order_item/request/form.php";
					}
		//Suborders/Transfers			
				else if(isset($_REQUEST['suborder_view'])){
					include"includes/suborder/view.php";
					}
					
				else if(isset($_REQUEST['suborder_add'])  || isset($_REQUEST['suborder_edit'])){
					include"includes/suborder/form.php";
					}
					
				else if(isset($_REQUEST['suborder_item_view'])){
					include"includes/suborder_item/request/view.php";
					}
					
				else if(isset($_REQUEST['suborder_item_add'])  || isset($_REQUEST['suborder_item_edit'])){
					include"includes/suborder_item/request/form.php";
				}
				
				else if(isset($_REQUEST['order_print'])){
					include"includes/order/receipt_print.php";
					}
				else if(isset($_REQUEST['production_suborder_item_view'])){
					include"includes/suborder_item/request/view.php";
					}
					
			else if(isset($_REQUEST['branch_report_creator'])){
					include"includes/reports/branch/form.php";
					}
			else if(isset($_REQUEST['branch_report_exporter'])){
					include"includes/reports/branch/export_view.php";
					}
			else if(isset($_REQUEST['branch_inventory_report_creator'])){
					include"includes/reports/branch_inventory/form.php";
					}
			else if(isset($_REQUEST['branch_inventory_report_exporter'])){
					include"includes/reports/branch_inventory/export_view.php";
					}
					
			else{
					include"includes/customer/view.php";
				}
	}

else if(isset($_SESSION["branch_supervisor"])){
			if(isset($_REQUEST['branch_store_view'])){
				include"includes/branch_store/view.php";
				}
			else if(isset($_REQUEST['branch_req_approve_view'])){
			include"includes/branch_req/approve/view.php";
			}
			
			else if(isset($_REQUEST['branch_approve_item_view'])){
			include"includes/branch_req_item/approve/view.php";
			}
			
			if(isset($_REQUEST['main_store_branch_view'])){
					include"includes/main_store/branch_view.php";
			}
			
			else if(isset($_REQUEST['branch_item_issue_approve_view'])){
			include"includes/branch_item_issue/approve_view.php";
			}
			
			else if(isset($_REQUEST['branch_item_issue_approved_view'])){
			include"includes/branch_item_issue/approved_view.php";
			}
			else if(isset($_REQUEST['branch_req_recieve_view'])){
					include"includes/branch_req/receive/view.php";
				}
				
			else if(isset($_REQUEST['branch_req_recieved_view'])){
					include"includes/branch_req/receive/received_view.php";
				}				
			else if(isset($_REQUEST['branch_recieve_item_view'])){
					include"includes/branch_req_item/receive/view.php";
					}	
			else if(isset($_REQUEST['branch_req_item_recieve'])){
					include"includes/branch_req_item/receive/form.php";
					}
			else if(isset($_REQUEST['branch_to_branch_req_approve_view'])){
			include"includes/branch_to_branch_req/approve/view.php";
			}
			
			else if(isset($_REQUEST['branch_to_branch_issue_approve_view'])){
			include"includes/branch_to_branch_req/approve/branch_to_view.php";
			}
			
			
			else if(isset($_REQUEST['branch_to_branch_approve_item_view'])){
			include"includes/branch_to_branch_req_item/approve/view.php";

			}
			
			else if(isset($_REQUEST['branch_to_branch_item_issue_approve_view'])){
			include"includes/branch_to_branch_item_issue/approve_view.php";
			}
				
			else if(isset($_REQUEST['branch_to_branch_req_recieve_view'])){
					include"includes/branch_to_branch_req/receive/view.php";
					}
					
			else if(isset($_REQUEST['branch_to_branch_recieve_item_view'])){
					include"includes/branch_to_branch_req_item/receive/view.php";
					}
					
			else if(isset($_REQUEST['branch_to_branch_req_item_recieve'])){
					include"includes/branch_to_branch_req_item/receive/form.php";
					}
				
				else{
					include"includes/branch_supervisor.php";
					}
	}
	
	else{
		include"includes/tiles.php";
			}						
	if(isset($_REQUEST['logout'])){
		include"content/logout.php";
		}
?>
 <?php if(!isset($_REQUEST	['order_print']) && !isset($_REQUEST['branch_report_exporter'])){?>
</div>
<?php }?>